package com.gome.han.cloud.consumer1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
* @author hanpeng
* @version 创建时间：2020年8月8日 下午12:57:45
* @ClassName 类名称
* @Description 类描述
*/
@SpringBootApplication
@EnableEurekaClient
@RestController
public class Application {
	@Autowired
    private RestTemplate restTemplate;
	@RequestMapping("/hello")
	public String home() {
		System.out.println("dfsdf");
		//return restTemplate.getForObject("http://SPRING-CLOUD-EUREKA-PROVIDER-ZONE/hi", String.class);
		return restTemplate.getForObject("http://SPRING-CLOUD-EUREKA-PROVIDER-ZONE/hi", String.class);
	}
	public static void main(String[] args) {
		SpringApplication.run(Application.class);
	}
}
